/********************************************************************************
 *  
 *  Product: GSAOBKeyMatchesLib
 *  Description: A C# API for Responsing to Google Search Appliance OneBoxModule.
 *
 *  (c) Copyright 2007 
 *  
********************************************************************************/
using System;
using System.Collections;
using System.Text;

namespace GSAOBKeyMatchesLib.Server
{
    /// <summary>
    /// Provides methods to create FieldObject for Response stream (refer to OneBox Response XML "Field" tag in GSA OneBox Developers guid)
    /// <para>Author Albert Ghukasyan</para>
    /// </summary>
    class FieldObject
    {
        #region Variables

        private ArrayList attributes = new ArrayList();
        private String value;

        #endregion

        #region Constructor

        public FieldObject(String name, String value) 
        { 
            this.addAttr("name", name);
            this.value = value;
        }

        #endregion

        #region Methods

        public void addAttr(String name, String value)
        {
            this.attributes.Add(name + "=\"" + value + "\""); 
        }

        public ArrayList getAttrs()
        { 
            return this.attributes; 
        }

        public String getValue() 
        {
            return value;
        }

        #endregion
    }
}
